<template>
{{#if ctrl.psSysPFPlugin}}
    {{> @macro/plugins/widget/widget-use.hbs appPlugin=ctrl.psSysPFPlugin}}
{{else}}
    {{#if ctrl.embeddedPSAppDEView}}
    <component
        :is="{{ctrl.embeddedPSAppDEView.codeName}}"
        name="{{ctrl.embeddedPSAppDEView.codeName}}"
        openType="EMBED"
        :context="store.context"
        :viewParams="store.viewParams"
        :class="classNames"
        :isLoadDefault="false"
        {{#or ctrl.width ctrl.height}}
		style="{{#if ctrl.width}}width: {{ctrl.width}}px;{{/if}}{{#if ctrl.height}}height: {{ctrl.height}}px;{{/if}}"
	    {{/or}}      
        @view-init="(name: string, data: any) => handleCtrlInit(controller, name, data)"
        @view-action="(name: string, action: string, data: IParam[]) => handleCtrlAction(controller, name, action, data)"
        @view-destroy="(name: string, data: any) => { handleCtrlDestroy(controller, name, data); }">
    </component>    
    {{/if}}
{{/if}}
</template>
<script setup lang="ts">
// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@TABVIEWPANEL}}-tab-view-panel/\{{spinalCase ctrl.codeName}}-tab-view-panel.vue.hbs生成
{{> @macro/plugins/widget/widget-import.hbs ctrl=ctrl}}
import { model } from "./{{spinalCase ctrl.codeName}}-tab-view-panel-model";
{{#if ctrl.embeddedPSAppDEView}}
import {{ctrl.embeddedPSAppDEView.codeName}} from '@views/{{#if ctrl.embeddedPSAppDEView.psAppModule.codeName}}{{spinalCase ctrl.embeddedPSAppDEView.psAppModule.codeName}}/{{/if}}{{spinalCase ctrl.embeddedPSAppDEView.codeName}}/{{spinalCase ctrl.embeddedPSAppDEView.codeName}}.vue';
{{/if}}
import { IContext, IParam, TabViewPanelController, TabViewPanelActionType, ITabViewPanelAbility, ITabViewPanelControllerParams, ITabViewPanelStore, ITabViewPanelController, ILoadingHelper, IViewCtx } from "@/core";
import {
    getCtrlClassNames,
    useEventBind,
    useNavParamsBind,
    handleCtrlInit,
    handleCtrlAction,
    handleCtrlDestroy
} from "@/hooks/use-ctrl";

{{> @macro/widgets/ctrl/ctrl-props.hbs}}

{{> @macro/common/emit.hbs name="ctrl" actionType="TabViewPanelActionType" ability="ITabViewPanelAbility"}}

//  部件样式名
const classNames = computed(() => {
  return getCtrlClassNames(model, props);
});
const params: ITabViewPanelControllerParams<TabViewPanelActionType, ITabViewPanelAbility> = {
    name: props.name,
    model,
    evt,
    actions: {},
    closeView: props.closeView,
    pLoadingHelper: props.pLoadingHelper,
    pViewCtx: props.pViewCtx,
    handler: (data: ITabViewPanelStore) => { return reactive(data); }
};

{{> @macro/common/controller.hbs name="ctrl" IController="ITabViewPanelController" store="ITabViewPanelStore" ability="ITabViewPanelAbility" controller="TabViewPanelController"}}
</script>
